package entity;

import java.util.Date;

public class WeatherAlert {
    
    private int id;
    private WeatherForecast forecast;
    private Date suggestedDate;
    private Event event;
    private AlertType alertType;

    public WeatherAlert() {
        forecast = new WeatherForecast();
        suggestedDate = new Date();
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public WeatherForecast getForecast() {
        return forecast;
    }

    public void setForecast(WeatherForecast forecast) {
        this.forecast = forecast;
    }

    public Date getSuggestedDate() {
        return suggestedDate;
    }

    public void setSuggestedDate(Date suggestedDate) {
        this.suggestedDate = suggestedDate;
    }

    public Event getEvent() {
        return event;
    }

    public void setEvent(Event event) {
        this.event = event;
    }

    public AlertType getAlertType() {
        return alertType;
    }

    public void setAlertType(AlertType alertType) {
        this.alertType = alertType;
    }
    
    public boolean isCreatorAlert() {
        return alertType == AlertType.CREATOR;
    }
    
    public boolean isParticipantAlert() {
        return alertType == AlertType.PARTICIPANT;
    }
    
    public boolean hasSuggestedDate() {
        return suggestedDate != null;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 89 * hash + this.id;
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final WeatherAlert other = (WeatherAlert) obj;
        return this.id == other.id;
    }
}